package com.rinlink.jbcodec.creator;

import com.alibaba.fastjson.JSONObject;
import com.rinlink.jbcodec.transform.BytesToBytesTransform;
import com.rinlink.jbcodec.transform.Transform;

public class BooleanToBytesCreator extends ObjectToBytesCreator<Boolean>{
    @Override
    protected Transform<byte[]> create(Boolean aBoolean, JSONObject attr, JSONObject source) {
        return new BytesToBytesTransform(aBoolean ? new byte[]{1} : new byte[]{0});
    }
}
